chroot
Change the root directory
chroot()
function changes the root directory of the current process to directory and changes the current working directory to "/".
Note: This function requires root permissions and is only available on GNU and BSD systems when using CLI, CGI, Embedded SAPI. This function is not implemented on the Windows platform.
Change the root directory:
<?php // Change the root directory chroot ( "/path/to/chroot/" ) ; // Obtain the current directory echo getcwd ( ) ; ?>
Results:
/
chroot ( directory ) ;
parameter | describe |
---|---|
Directory | Required. Specify the new root directory path. |